package com.cade.agriculturemall.view.retrievePassword;

import com.cade.agriculturemall.base.BasePresenter;

/**
 * Created by Lobby on 2017/11/16.
 */

public class RetrievePasswordPresenter extends BasePresenter<RetrievePasswordContract.IView> implements RetrievePasswordContract.IPresenter {

    @Override
    public void onResume() {

    }

    @Override
    public void onCreate() {

    }

    @Override
    public void onDestroy() {

    }

    public RetrievePasswordPresenter(RetrievePasswordContract.IView view) {
        super(view);
    }



    @Override
    public void upPassWord(final String phone, String psw, String code) {


        mView.showSuccess("账号："+phone+" 的密码已修改成功");
//        AVUser.resetPasswordBySmsCodeInBackground(code, psw, new UpdatePasswordCallback() {
//            @Override
//            public void done(AVException e) {
//                if (e == null) {
//                    mView.showSuccess("账号："+phone+" 的密码已修改成功");
//                } else {
//                    e.printStackTrace();
//                }
//            }
//        });
    }

    @Override
    public void getCode(final String phone) {

        mView.showSuccess("验证码已发送至账号："+phone);
        mView.showOther(1);

//        AVUser.requestPasswordResetBySmsCodeInBackground(phone, new RequestMobileCodeCallback() {
//            public void done(AVException e) {
//                if (e == null) {
//                    mView.showSuccess("验证码已发送至账号："+phone);
//                    mView.showOther(1);
//                } else {
//                    e.printStackTrace();
//                }
//            }
//        });
    }
}
